﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PaynetApi.Requests
{
    public class Response
    {
        
        //Return_Code, Approv_Num, Card_Response, and AVS_Response.VoidRecNu
        public string ReturnCode { get; set; }
        public string ApprovalNumber { get; set; }
        public string CardResponse { get; set; }
        public string AvsResponse { get; set; }
        public string VoidRecNumber { get; set; }
        //N,Not Approved,Merchant Record not on file,E,-23,END
        //Y,00566Z,Approved,N, 11679251,END
        public Response(string paynetResponse)
        {
            string[] parsedResponse = paynetResponse.Split(',');

            ReturnCode = parsedResponse[0];
            ApprovalNumber = parsedResponse[1];
            CardResponse = parsedResponse[2];
            AvsResponse = parsedResponse[3];
            VoidRecNumber = parsedResponse[4];
        }
    }
}
